﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;

namespace FrameWork.BasePage
{
    /// <summary>
    /// HttpModule类，在请求开始时就来检测双方的票证值
    /// </summary>
public class RefreshModule : IHttpModule  

{  
    public RefreshModule()
    {  
    }  

    #region IHttpModule Members   

    public void Dispose() 
    {  
        throw new NotImplementedException(); 
    }  

    public void Init(HttpApplication app)
    {  

        //注册请求关联状态时的事件处理器，就是说当一个请求到达服务器，   

        //那么首先触发这个事件,由OnAcquireRqeustState事件处理   

        app.AcquireRequestState += new EventHandler(this.OnAcquireRequestState);  

    }  

    #endregion   

    private void OnAcquireRequestState(object sender, EventArgs e)
    {  

        HttpApplication app = sender as HttpApplication;  
        HttpContext ctx = app.Context; 
        RefreshAction.Check(ctx); //RefreshAction类来检查当前请求的上下文 Rey 
        return;  

    }  

}//end class 
}
